<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//网站首页
Route::get('/', ['uses'=>'PostController@index']);


//用户登录模块
Route::get('/register',['uses'=>'user\RegisterController@index']); //注册页
Route::post('/register',['uses'=>'user\RegisterController@register']); //注册
Route::get('/login',['uses'=>'user\LoginController@index','as'=>'login']); //登录页
Route::post('/login',['uses'=>'user\LoginController@login']); //登录
Route::get('/logout',['uses'=>'user\LoginController@logout']); //登出
Route::get('/user/me/setting',['uses'=>'user\UserController@setting']); //个人设置
Route::post('/user/me/setting', ['uses'=>'user\UserController@settingStore']); //个人设置保存

/*文章模块*/
//文章列表
Route::get('/posts',['uses'=>'PostController@index']);
//文章新增
Route::get('/posts/create',['uses'=>'PostController@create']);
Route::post('/posts',['uses'=>'PostController@save']);
//文章详情,带的参数为文章对象
Route::get('/posts/d/{post}',['uses'=>'PostController@detail']);
//文章编辑,带的参数为文章对象
Route::get('/posts/{post}/edit',['uses'=>'PostController@edit']);
Route::put('/posts/{post}',['uses'=>'PostController@update']);
//文章删除
Route::get('/posts/{id}/delete',['uses'=>'PostController@delete']);
//文章评论
Route::post('/posts/comment',['uses'=>'PostController@comment']);
//点赞
Route::get('/posts/{post}/zan',['uses'=>'PostController@zan']);
//取消赞
Route::get('/posts/{post}/unzan',['uses'=>'PostController@unzan']);

//文章上传图片
Route::post('/posts/image/upload',['uses'=>'PostController@imageUpload']);

